package com.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.entity.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CourseMapper extends BaseMapper<Course> {

    /**
     * 检查课程编号是否存在
     */
    @Select("SELECT COUNT(*) FROM courses WHERE code = #{code}")
    boolean existsByCode(String code);
}
